//--------------------------------------------------------------------------------
/*!
\file	Sound.cpp
\author	bsmith, dkarp
\date	04/16/07
\brief	Encompasses a loaded sound
\par	license
Copyright (c) DigiPen Institute of Technology 2006. All Rights Reserved. 
*/
//--------------------------------------------------------------------------------
#include "stdafx.h"
#include "LowLevel.h"


namespace sndcore
{

//-------------------------------------------------------------------------------
/*!
\brief Get length of song
\return song length in milliseconds

\author	Danny Karp
*/
//-------------------------------------------------------------------------------
int Sound::GetSongLength() const 
{ 
	if( buffer_ )
		return buffer_->GetOptions().songlen_;
	else
		return 0;
}
//-------------------------------------------------------------------------------
/*!
\brief Get bits per sample
\return bits per sample

\author Danny Karp
*/
//-------------------------------------------------------------------------------
int Sound::GetBitsPerSample() const
{
	if( buffer_ )
		return buffer_->GetOptions().format_.wBitsPerSample;
	else
		return 0;
}
//-------------------------------------------------------------------------------
/*!
\brief Get number channels
\return channels

\author	Danny Karp
*/
//-------------------------------------------------------------------------------
int Sound::GetNumChannels() const
{
	if( buffer_ )
		return buffer_->GetOptions().format_.nChannels;
	else
		return 0;
}
//-------------------------------------------------------------------------------
/*!
\brief Get sample rate
\return sample rate

\author	Danny Karp
*/
//-------------------------------------------------------------------------------

int Sound::GetFrequency() const
{
	if( buffer_ )
		return buffer_->GetOptions().format_.nSamplesPerSec;
	else
		return 0;
}

}